import request from '../index'

export function getBannerList(index: number, size: number) {
  return request.get('/banner', {
    index,
    size
  })
}

export function addBanner(data: { imageUrl: string, slogan?: string, url?: string }) {
  return request.post('/banner', data)
}

export function editBanner(data: { id: string, imageUrl?: string, slogan?: string, url?: string, show?:boolean, sort?:number }) {
  return request.put('/banner', data)
}

export function delBanner(id: string) {
  return request.delete('/banner', {
    id
  })
}